﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Twi.COMMON.Core;
using Twi.DataAccess.Common;

namespace Twi.Modules.Demo
{
    public class ModuleHelper
    {

        //不能声明为public，防止在Page或其他引用层直接调用.
        private static string connstr = "DemoConnectionString";
        internal static readonly DbUtility DBHelper = new DbUtility(TwiConfigHelper.GetConnectionString(connstr), TwiConfigHelper.GetProviderName(connstr));
        internal static readonly DACommon DBCommonHelper = new DACommon(DBHelper);

        //字段映射字典
        public static Dictionary<string, string> GetFieldMapping()
        {
            Dictionary<string, string> dictMapping = new Dictionary<string, string>();

            //尽量按字母顺序排列，这样方便人工查找
            dictMapping.Add("FID", "FID");
            dictMapping.Add("FNAME", "FName");            
            dictMapping.Add("FREMARK", "FRemark");
            dictMapping.Add("FSORT", "FSort");

            return dictMapping;
            
        }
    }
}
